package com.easy.test;



import com.easy.common.IAutoScan;
import com.easy.common.IWork;
import com.easy.threads.entity.TaskParameter;
import com.easy.threads.singleton.WarehouseSingleton;

import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

/**
 * 描述:
 *
 * @author gwj
 * @date 2023年12月15日 15:13
 */

public class ScanTest2 implements IAutoScan {
    /**
     * @throws Exception
     */
    @Override
    public void scan() throws Exception {
        List<IWork> work = new CopyOnWriteArrayList<>();
        for (int i = 0; i <5 ; i++) {
            WorkTest1 workTest1 = new WorkTest1();
            TaskParameter taskParameter = new TaskParameter();
            taskParameter.setTaskName("TEST--TASK--LS--"+i);
            workTest1.setTaskParameter(taskParameter);
            work.add(workTest1);

        }
        WarehouseSingleton.WAREHOUSE_SINGLETON.getInstance().addWork(work,"TEST-LS");
    }
}
